package edu.uta.ui;
import edu.uta.ui.R;
import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
/**
 * @author fall 2011 team5
 * 
 */
/*
 * References
 *   http://developer.android.com/resources/tutorials/views
 *   http://en.androidwiki.com/wiki/Dynamically_adding_rows_to_TableLayout
 */
//main activity
public class AirQualityMainActivity extends TabActivity
{
	/** Called when the activity is first created. */

	@Override    
	public void onCreate(Bundle savedInstanceState) 
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		TabHost tabHost = getTabHost();
		// Tab for Home  
		TabSpec homespec = tabHost.newTabSpec("Home");
		homespec.setIndicator("Home", getResources().getDrawable(R.drawable.icon_home_tab));
		Intent homeIntent = new Intent(this, HomeActivity.class);
		homespec.setContent(homeIntent);
		// Tab for Map       
		TabSpec mapspec = tabHost.newTabSpec("Map");
		mapspec.setIndicator("Map", getResources().getDrawable(R.drawable.icon_map_tab));
		Intent mapIntent = new Intent(this, AQIMap.class);
		mapspec.setContent(mapIntent);
		// Tab for Zipcode      
		TabSpec zipspec = tabHost.newTabSpec("Zipcode");
		// setting Title and Icon for the Tab
		zipspec.setIndicator("Zipcode", getResources().getDrawable(R.drawable.icon_zip_tab));
		Intent zipIntent = new Intent(this, ZipActivity.class);
		zipspec.setContent(zipIntent);
		// Tab for Help  
		TabSpec helpspec = tabHost.newTabSpec("Help");
		helpspec.setIndicator("Help", getResources().getDrawable(R.drawable.icon_help_tab));
		Intent helpIntent = new Intent(this, HelpActivity.class);
		helpspec.setContent(helpIntent);

		// Adding all TabSpec to TabHost
		tabHost.addTab(homespec); // Adding help tab
		tabHost.addTab(mapspec); // Adding map tab    
		tabHost.addTab(zipspec); // Adding zip tab 
		tabHost.addTab(helpspec); // Adding help tab
	}


}